package it.polimi.traveldream.ejbclient.dtos;

import it.polimi.traveldream.utils.enums.UserRole;

import java.io.Serializable;
import java.sql.Timestamp;


public class UserDTO implements Serializable {
	private static final long serialVersionUID = -5932315651078548837L;
	private int id;
	private String email;
	private String name;
	private String password;
	private Timestamp registration;
	private UserRole role;
	private String surname;
	
	public UserDTO() {
		super();
	}
	

	public UserDTO(int id, String email, String name, String password,
			Timestamp registration, UserRole role, String surname) {
		super();
		this.id = id;
		this.email = email;
		this.name = name;
		this.password = password;
		this.registration = registration;
		this.role = role;
		this.surname = surname;
	}


	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public Timestamp getRegistration() {
		return registration;
	}

	public void setRegistration(Timestamp registration) {
		this.registration = registration;
	}

	public UserRole getRole() {
		return role;
	}

	public void setRole(UserRole role) {
		this.role = role;
	}

	public String getSurname() {
		return surname;
	}

	public void setSurname(String surname) {
		this.surname = surname;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + id;
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		UserDTO other = (UserDTO) obj;
		if (id != other.id)
			return false;
		return true;
	}
	
}
